from http import HTTPStatus
from dashscope import VideoSynthesis

response = VideoSynthesis.call(model="wanx2.1-i2v-turbo",
                               prompt="一只猫在草地上奔跑",
                               img_url="https://cdn.translate.alibaba.com/r/wanx-demo-1.png",
                               api_key="sk-d627b203e53749d29fa442a66b5411d6")
if response.status_code == HTTPStatus.OK:
    print(response.output.video_url)
else:
    print('Failed, status_code: %s, code: %s, message: %s' %
          (response.status_code, response.code, response.message))